package com.ruoyi.chiwen.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.chiwen.mapper.TbBankcardMapper;
import com.ruoyi.chiwen.domain.TbBankcard;
import com.ruoyi.chiwen.service.ITbBankcardService;

/**
 * 银行卡Service业务层处理
 * 
 * @author chiwen
 * @date 2021-06-14
 */
@Service
public class TbBankcardServiceImpl implements ITbBankcardService 
{
    @Autowired
    private TbBankcardMapper tbBankcardMapper;

    /**
     * 查询银行卡
     * 
     * @param bankId 银行卡ID
     * @return 银行卡
     */
    @Override
    public TbBankcard selectTbBankcardById(Long bankId)
    {
        return tbBankcardMapper.selectTbBankcardById(bankId);
    }

    /**
     * 查询银行卡列表
     * 
     * @param tbBankcard 银行卡
     * @return 银行卡
     */
    @Override
    public List<TbBankcard> selectTbBankcardList(TbBankcard tbBankcard)
    {
        return tbBankcardMapper.selectTbBankcardList(tbBankcard);
    }

    /**
     * 新增银行卡
     * 
     * @param tbBankcard 银行卡
     * @return 结果
     */
    @Override
    public int insertTbBankcard(TbBankcard tbBankcard)
    {
        tbBankcard.setCreateTime(DateUtils.getNowDate());
        return tbBankcardMapper.insertTbBankcard(tbBankcard);
    }

    /**
     * 修改银行卡
     * 
     * @param tbBankcard 银行卡
     * @return 结果
     */
    @Override
    public int updateTbBankcard(TbBankcard tbBankcard)
    {
        tbBankcard.setUpdateTime(DateUtils.getNowDate());
        return tbBankcardMapper.updateTbBankcard(tbBankcard);
    }

    /**
     * 批量删除银行卡
     * 
     * @param bankIds 需要删除的银行卡ID
     * @return 结果
     */
    @Override
    public int deleteTbBankcardByIds(Long[] bankIds)
    {
        return tbBankcardMapper.deleteTbBankcardByIds(bankIds);
    }

    /**
     * 删除银行卡信息
     * 
     * @param bankId 银行卡ID
     * @return 结果
     */
    @Override
    public int deleteTbBankcardById(Long bankId)
    {
        return tbBankcardMapper.deleteTbBankcardById(bankId);
    }
}
